package com.wk.quickstart.controller;

import com.wk.quickstart.pojo.User;
import com.wk.quickstart.cache.MyCache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by wangkuan at 2020-05-26 14:55
 */
@RestController
@RequestMapping("my")
public class MyController {

    @Autowired
    private MyCache myCache;

    @GetMapping("user")
    public User get(Long id) {
        return myCache.get(id);
    }
}
